package com.addplus.townmall.server.api.mapper.town;

import com.addplus.townmall.server.api.model.town.PayType;
import com.addplus.townmall.server.api.utils.BaseAddMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 支付方式表 Mapper 接口
 * </p>
 *
 * @author zhangjiehang
 * @since 2018-08-27
 */
public interface PayTypeMapper extends BaseAddMapper<PayType> {


    @Select("SELECT p.id,p.pay_name,p.pay_icon FROM pay_type p LEFT JOIN pay_platform_config c ON c.pay_type_id = p.Id WHERE c.platform_type = #{platform_type} AND p.is_delete = 0 AND c.is_delete = 0 AND c.is_show = 1\n" +
            "ORDER BY c.sort")
    List<PayType> getPayTypeListByPlatform(@Param("platform_type") Integer platformType);

}
